<template>

  <div style="width: 60%;margin: auto">
    <comparedComponents
        style="float: left"
        v-for="data in dataList"
        :key="data.id"
        :data="data">
    </comparedComponents>

  </div>
</template>

<script>
import comparedComponents from "@/components/user/Components/Components/comparedComponents";

export default {
  name: "compared",
  data() {
    return {
      dataList: [],
      list: [],
    }
  },
  methods: {
    async initList() {
      const {data: res} = await this.$http.get('/task/taskTasks', {
        params: {list: this.list},
        paramsSerializer: function (params) {
          const url = params.list.map(_ => `ids=${_}`).join('&');
          return `${url}`;
        }
      })
      this.dataList = res.content
    }
  },
  mounted() {
    for (let i = 0; i < this.$route.query.dataList.length; i++) {
      this.list.push(this.$route.query.dataList[i].comparedUserId)
    }

    this.initList()

  },
  components: {
    comparedComponents
  }
}
</script>

<style scoped>

</style>